import React from 'react';
import { Row } from 'antd';
import { UploadOssLite } from '@/containers';
import { formatToThreePart } from '@/utils/utils';

import { oneLineLayout, renderItem } from '../util';

export default function SuggestSalary({ commInfo }) {
    return (
        <>
            <Row>
                {renderItem({
                    label: '原月薪',
                    value: (
                        <>
                            {formatToThreePart(commInfo?.recruitSalaryRecordVO?.monthSalary) ?? ''}
                            <span style={{ padding: '0 5px' }}>X</span>
                            {commInfo?.recruitSalaryRecordVO?.monthNumber ?? ''}{' '}
                            <span>{commInfo?.recruitSalaryRecordVO?.currentSalaryCurrencyCode || '月'}</span>
                        </>
                    )
                })}
                {renderItem({
                    label: '原年薪',
                    value: (
                        <>
                            {formatToThreePart(commInfo?.recruitSalaryRecordVO?.yearSalary)}{' '}
                            <span>{commInfo?.recruitSalaryRecordVO?.currentSalaryCurrencyCode}</span>
                        </>
                    )
                })}
            </Row>
            <Row>
                {renderItem({
                    label: '薪资说明',
                    value: commInfo?.recruitSalaryRecordVO?.remark,
                    span: 24,
                    layout: oneLineLayout
                })}
            </Row>
            <Row>
                <UploadOssLite
                    label="薪资证明"
                    editable={false}
                    initialValue={commInfo?.recruitSalaryRecordVO?.salaryProveUrl}
                    {...oneLineLayout}
                />
            </Row>
        </>
    );
}
